#include "UpdateRanking.h"
#include "FiniteStateMachine.h"

UpdateRanking::UpdateRanking(void)
{
}


UpdateRanking::~UpdateRanking(void)
{
}

void UpdateRanking::Execute( void* aFsm )
{
	FiniteStateMachine<Tournament>* fsm= reinterpret_cast<FiniteStateMachine<Tournament>*>(aFsm);
	Tournament * t= fsm->mActor;
	t->UpdateRanking(t->mChallengeTree->GetRoot());
	t->mCurrentDepthChallenge --;
	if(t->mCurrentDepthChallenge==1){
		std::cout<< std::endl<< "|||||||||||||||||--FINALI--||||||||||||||||||"<<std::endl;
	}
	if(t->mCurrentDepthChallenge==2){
		std::cout<< std::endl<< "|||||||||||||||||--SEMIFINALI--||||||||||||||||||"<<std::endl;
	}
	fsm->ChangeState(new UpdateRanking);
}
